<html>
	<head>
		<title>Facebook AS3 API Connect Demo</title>

		<!-- include the API from facebook's server  -->
		<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> 
		
		<!-- include swfobject library -->
		<script type="text/javascript" src="swfobject.js"></script>
	</head>
	
	<body>
	
		<script type="text/javascript">
			FB_RequireFeatures(["Api"], function() {
				FB.Facebook.init('YOUR_API_KEY', 'xd_receiver.htm');				
			});
								
			FB.Bootstrap.requireFeatures(["Connect"], function() {
				FB.Connect.requireSession(function(exception) {
					//define your flashVars
					//Pull out the current session data from Facebook
					var sessionData = FB.Facebook.apiClient.get_session();
					
					//And pass it into the swf via Flashvars
					//Also pass in the name of your .swf 
						//which should be the same as in your call to embedSWF()
					var flashVars = {
						as_swf_name: "flashContent",
						session_key: sessionData.session_key,
						secret:sessionData.secret
					};
					
					//create your instance of your .swf
					var params = {wmode: "transparent"}; //wmode must be transparent or else ajax windows will not show up over swf
					swfobject.embedSWF("ConnectJSDemo.swf", "flashContent", "100%", "100%", "9.0.0", "expressInstall.swf", flashVars, params);
				});
			});
			
		</script>
		<!--  this is where your flash content will be placed when created -->
		<div id="flashContent"></div>
		
	</body>
</html>